/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 晓星航
 * Date: 2022-10-24
 * Time: 17:48
 */
class Person{
    private int age;
    private String sex;
    private String name;
    public Person() {
        System.out.println("不带参数的构造方法");
    }
    public Person(int age,String sex,String name){
        this.age = age;
        this.sex = sex;
        this.name = name;
    }
    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "Person{" +
                "age=" + age +
                ", sex='" + sex + '\'' +
                ", name='" + name + '\'' +
                '}';
    }
}
public class TestDemo {
    public static void main(String[] args) {

    }
    public static void main1(String[] args) {
        Person person1 = new Person(18,"男","huangneng");
        Person person2 = new Person();
        System.out.println(person1.toString());
    }
}
